package com.ericsson.smart.constant;

public enum DimensionEnum {
	// DIM_GEOGRAPHY("DIM_GEOGRAPHY", GeographyDimension.class),
	// DIM_TIME("DIM_TIME", TimeDimension.class);

	DIM_GEOGRAPHY("DIM_GEOGRAPHY", "GEO_ID"), DIM_TIME("DIM_TIME", "TIME_ID"), DIM_SUBSTATION(
			"DIM_SUBSTATION", "DIM_SUBSTATION_ID"), DIM_CUSTOMER(
			"DIM_CUSTOMER", "CUSTOMER_ID"), DIM_TRANSFORMER_METER_TYPE(
			"DIM_TRANSFORMER_METER_TYPE", "TYPE_ID"), DIM_SEVERITY(
			"DIM_SEVERITY", "SEVERITY_ID");

	private String table;
	private String id;

	public String getTable() {
		return table;
	}

	public String getIdColumn() {
		return id;
	}

	DimensionEnum(String table, String id) {
		this.table = table;
		this.id = id;
	}

	public static DimensionEnum getDimensionEnum(String tableName) {
		for (DimensionEnum d : DimensionEnum.values()) {
			if (d.getTable().equalsIgnoreCase(tableName)) {
				return d;
			}
		}
		return null;
	}
}
